//导入 axios 的封装对象
import {request} from '@utils/http'
import type { HospitalSetItem, ReqAddHospitalSetParams, ReqHospitalSetListParams, ReqHospitalSetListResponse, ReqUpdateHospitalParams } from './model/hospitalSetTypes'

/**
 * 批量获取医院设置的信息
 * @param param0 ReqHospitalSetListParams  请求参数对象
 * @returns  Promise<ReqHospitalSetListResponse>
 */
export function reqGetHospitalSetList({
  page, 
  limit, 
  hosname, 
  hoscode
}:ReqHospitalSetListParams){
  return request.get<any, ReqHospitalSetListResponse>(
    //URL 参数
    `/admin/hosp/hospitalSet/${page}/${limit}`,
    //query 参数
    {
      params: {
        hosname: hosname,
        hoscode: hoscode
      }
    }
  )
}

// 新增医院信息
export function reqAddhospitalSetItem(hospitalSet:ReqAddHospitalSetParams){
   return request.post<any,null>('/admin/hosp/hospitalSet/save',hospitalSet);
}

// // //获取
// export function  reqGethospitalSetItem(id:string){
//     return request.get<any,HospitalSetItem>(`/admin/hosp/hospitalSet/get/${id}`)
// }


//删除
export function removehospitalSetItem(id:number){
    return request.delete(`/admin/hosp/hospitalSet/remove/${id}`);
}

//批量删除
export function reqBatchRemoveHospitalSet(idList: React.Key[]){
  return request.delete('/admin/hosp/hospitalSet/batchRemove', {
    data: idList
  })
}